Interview Question in Sql Server 2005


 

Interview Question :: Named Pipes Provider: Could not open a connection to SQL Server [53]

I am trying to connect to a SQL server 2005 using perl and the Win32-SqlServer module. I can connect to that server using MS Access but my Perl script will timeout. I have checked that the config allows remote connection to the server both with named papies or with TCP/IP. I have tried using the IP address of the server as opposed to the name of the server. Db name, username and password have been double checked.

Here's the test code that I am trying to run :

use Win32::SqlServer;

# my $server = "server.domain.com"; # hidden for this post.
my $server = "xxx.xxx.xxx.xxx"; # Hidden for this post.
my $user = "user";
my $pw = "pass";
my $provider = "SQLNCLI";

$sqlsrv = Win32::SqlServer->sql_init($server, $user, $pw, $database, $provider);
$sqlsrv = Win32::SqlServer->new();
$sqlsrv->setloginproperty($property, $value);
$stats = $sqlsrv->connect();
$sqlsrv->disconnect();
$ret = $sqlsrv->isconnected()

What could be the possible causes for that problem?

Thank you very muc
by ksk